/*
 Copyright 2009 Abdulla Abdurakhmanov (abdulla@latestbit.com)
 Original sources are available at www.latestbit.com

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

 SmartObject.hpp. Created on: 13.10.2009 17:14:28 
 */

#ifndef SMARTOBJECT_HPP_
#define SMARTOBJECT_HPP_

#include "smartobjects/SmartObjectsDefs.hpp"
#include "smartobjects/ISmartObject.hpp"

namespace smartobjects {

class SmartObject : public virtual ISmartObject {
public:
	SO_DLLPRFX SmartObject();
	SO_DLLPRFX SmartObject(const std::string& sInstanceId);
	SO_DLLPRFX virtual ~SmartObject();

	SO_DLLPRFX virtual const std::string& getInstanceId() const;
	SO_DLLPRFX virtual ISmartBus* getBus() const;
	SO_DLLPRFX virtual void setBus(ISmartBus* poBus);
	SO_DLLPRFX virtual time_t getLastActivityTime() const;
	SO_DLLPRFX virtual void updateLastActivity();
	SO_DLLPRFX virtual SmartBusServer* getBusServer() const;
	SO_DLLPRFX virtual SmartBusClient* getBusClient() const;

protected:
	SO_DLLPRFX virtual void setInstanceId(const std::string&);

protected:
	std::string m_sInstanceId;

	SmartBusClient* m_poBusClient;
	SmartBusServer* m_poBusServer;
	time_t m_nLastActivityTime;
	ISmartBus* m_poBus;
};

}

#endif /* SMARTOBJECT_HPP_ */
